package cn.dm.service.impl;

import cn.dm.mapper.DmItemCommentMapper;
import cn.dm.pojo.DmItemComment;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class DmItemCommentServiceImpl {
    @Resource
    private DmItemCommentMapper dmItemCommentMapper;
    @RequestMapping(value = "/getDmItemCommentById",method = RequestMethod.POST)
    public DmItemComment getDmItemCommentById(@RequestParam("id") Long id)throws Exception{
        return dmItemCommentMapper.getDmItemCommentById(id);
    }

    @RequestMapping(value = "/getDmItemCommentListByMap",method = RequestMethod.POST)
    public List<DmItemComment> getDmItemCommentListByMap(@RequestBody Map<String, Object> param)throws Exception{
        return dmItemCommentMapper.getDmItemCommentListByMap(param);
    }

    @RequestMapping(value = "/getDmItemCommentCountByMap",method = RequestMethod.POST)
    public Integer getDmItemCommentCountByMap(@RequestBody Map<String, Object> param)throws Exception{
        return dmItemCommentMapper.getDmItemCommentCountByMap(param);
    }

    @RequestMapping(value = "/qdtxAddDmItemComment",method = RequestMethod.POST)
    public Integer qdtxAddDmItemComment(@RequestBody DmItemComment dmItemComment)throws Exception{
        return dmItemCommentMapper.insertDmItemComment(dmItemComment);
    }

    @RequestMapping(value = "/qdtxModifyDmItemComment",method = RequestMethod.POST)
    public Integer qdtxModifyDmItemComment(@RequestBody DmItemComment dmItemComment)throws Exception{
        return dmItemCommentMapper.updateDmItemComment(dmItemComment);
    }
}
